﻿function am_alert(title,content){
var html='<div class="am-modal am-modal-alert" tabindex="-1" id="am_alert"><div class="am-modal-dialog"><div class="am-modal-hd">'+title+'</div><div class="am-modal-bd">'+ content+'</div><div class="am-modal-footer"><span class="am-modal-btn">确定</span></div></div></div>';
$("body").append(html);
$("#am_alert").modal();
$("#am_alert").on("closed.modal.amui",function(){
	this.remove();
});
}

function am_confirm(title,content,okfun,cancelfun){
var html='<div class="am-modal am-modal-confirm" tabindex="-1" id="am-confirm"><div class="am-modal-dialog"> <div class="am-modal-hd">'+title+'</div><div class="am-modal-bd">'+content+'</div><div class="am-modal-footer"><span class="am-modal-btn" data-am-modal-cancel id="am-confirm-cancel">取消</span><span class="am-modal-btn" data-am-modal-confirm id="am-confirm-ok">确定</span></div></div></div>';
$("body").append(html);
$("#am_confirm").modal();
$("#am-confirm #am-confirm-cancel" ).click(function(){
	if(typeof(cancelfun)==="function"){
		call(cancelfun);
	}
	$("#am_confirm").modal("close");
});
$("#am-confirm #am-confirm-ok" ).click(function(){
	if(typeof(okfun)==="function"){
		call(okfun);
	}
	$("#am_confirm").modal("close");
});
$("#am_confirm").on("closed.modal.amui",function(){
	this.remove();
});
}


